package funcs

import (
	"fmt"
	"strings"
)

func Slice2String(a ...interface{}) string {

	//strs:=[]string{"127.0.0.1","10.0.10.113"}
	//strs:=[]string{"127.0.0.1"}
	//fmt.Println(strings.Trim(fmt.Sprint(strs),"[]"))
	//str1:=strings.Trim(fmt.Sprint(strs),"[]")
	//str2:=strings.Replace(str1," ","|",-1)
	//println(str2)

	var result string
	//注意这里用符号“|”进行了分割，如果是1个元素或者最后那个元素是没有符号“|”
	//所以在
	//fmt.Println(len(a))

	result = strings.Replace(strings.Trim(fmt.Sprint(a), "[]"), " ", "|", -1)
	return result + "|"

}
